| Fully Qualified Name: | Zend\Http\Client\Adapter\Curl |
| Implements: | AdapterInterface, StreamInterface |
An adapter class for Zend\Http\Client based on the curl extension.
Curl requires libcurl. See for full requirements the PHP manual: http://php.net/curl
| Name | Description | Defined By |
|---|---|---|
| __construct() | Adapter constructor | Curl |
| close() | Close the connection to the server | Curl |
| connect() | Initialize curl | Curl |
| getConfig() | Retrieve the array of all configuration options | Curl |
| getHandle() | Get cUrl Handle | Curl |
| read() | Return read response from server | Curl |
| readHeader() | Header reader function for CURL | Curl |
| setCurlOption() | Direct setter for cURL adapter related options. | Curl |
| setOptions() | Set the configuration array for the adapter | Curl |
| setOutputStream() | Set output stream for the response | Curl |
| write() | Send request to the remote server | Curl |
Adapter constructor
Config is set using setOptions()
Returns:
Close the connection to the server
Returns:
Initialize curl
| Parameter Name | Type | Description |
|---|---|---|
| $host | string | |
| $port | int | |
| $secure | bool |
Returns: void
Retrieve the array of all configuration options
Returns: array
Get cUrl Handle
Returns: resource
Return read response from server
Returns: string
Header reader function for CURL
| Parameter Name | Type | Description |
|---|---|---|
| $curl | resource | |
| $header | string |
Returns: int
Direct setter for cURL adapter related options.
| Parameter Name | Type | Description |
|---|---|---|
| $option | string|int | |
| $value | mixed |
Returns: \Curl
Set the configuration array for the adapter
| Parameter Name | Type | Description |
|---|---|---|
| $options | array|\Traversable |
Returns: \Curl
Set output stream for the response
| Parameter Name | Type | Description |
|---|---|---|
| $stream | resource |
Returns: \Curl
Send request to the remote server
| Parameter Name | Type | Description |
|---|---|---|
| $method | string | |
| $uri | \Zend\Uri\Uri | |
| $httpVersion | float | |
| $headers | array | |
| $body | string |
Returns: string $request